home *** CD-ROM | disk | FTP | other *** search
-
-
-
- CCCCwwwwdddd((((3333)))) 22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) CCCCwwwwdddd((((3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- getcwd - get pathname of current working directory
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- use Cwd;
- $dir = cwd;
-
- use Cwd;
- $dir = getcwd;
-
- use Cwd;
- $dir = fastgetcwd;
-
- use Cwd 'chdir';
- chdir "/tmp";
- print $ENV{'PWD'};
-
- use Cwd 'abs_path';
- print abs_path($ENV{'PWD'});
-
- use Cwd 'fast_abs_path';
- print fast_abs_path($ENV{'PWD'});
-
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The _g_e_t_c_w_d() function re-implements the _g_e_t_c_w_d(3) (or
- _g_e_t_w_d(3)) functions in Perl.
-
- The _a_b_s__p_a_t_h() function takes a single argument and returns
- the absolute pathname for that argument. It uses the same
- algoritm as _g_e_t_c_w_d(). (actually _g_e_t_c_w_d() is _a_b_s__p_a_t_h("."))
-
- The _f_a_s_t_c_w_d() function looks the same as _g_e_t_c_w_d(), but runs
- faster. It's also more dangerous because it might
- conceivably _c_h_d_i_r() you out of a directory that it can't
- _c_h_d_i_r() you back into. If fastcwd encounters a problem it
- will return undef but will probably leave you in a different
- directory. For a measure of extra security, if everything
- appears to have worked, the _f_a_s_t_c_w_d() function will check
- that it leaves you in the same directory that it started in.
- If it has changed it will die with the message "Unstable
- directory path, current directory changed unexpectedly".
- That should never happen.
-
- The _f_a_s_t__a_b_s__p_a_t_h() function looks the same as _a_b_s__p_a_t_h(),
- but runs faster. And like _f_a_s_t_c_w_d() is more dangerous.
-
- The _c_w_d() function looks the same as getcwd and fastgetcwd
- but is implemented using the most natural and safe form for
- the current architecture. For most systems it is identical
- to `pwd` (but without the trailing line terminator).
-
-
-
-
- Page 1 (printed 10/23/98)
-
-
-
-
-
-
- CCCCwwwwdddd((((3333)))) 22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) CCCCwwwwdddd((((3333))))
-
-
-
- It is recommended that cwd (or another *_c_w_d() function) is
- used in _a_l_l code to ensure portability.
-
- If you ask to override your _c_h_d_i_r() built-in function, then
- your PWD environment variable will be kept up to date. (See
- the section on _O_v_e_r_r_i_d_i_n_g _B_u_i_l_t_i_n _F_u_n_c_t_i_o_n_s in the _p_e_r_l_s_u_b
- manpage.) Note that it will only be kept up to date if all
- packages which use chdir import it from Cwd.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 2 (printed 10/23/98)
-
-
-
-